package main

import "fmt"

func main() {
	OutputRowColumn3(9, 9)
}

//传入的参数，用来指定输出的*阵是几列
func OutputRowColumn(row, col int) {
	var res int = 0
	for i := 1; i <= row; i++ {
		for j := 1; j <= col; j++ {
			res = i * j
			//fmt.Print(res)
			if j <= i {
				fmt.Print(j, "*", i, "=", res, " ")
			}
		}
		fmt.Println()
	}

}

func OutputRowColumn2(row, col int) {
	//var res int = 0
	for i := 1; i <= row; i++ {
		for j := 1; j <= col; j++ {
			//res = i * j
			//fmt.Print(res)
			if j <= i {
				fmt.Printf("%d*%d=%d \t", j, i, j*i)
			}
		}
		fmt.Println()
	}

}
func OutputRowColumn3(row, col int) {
	//var res int = 0
	for i := 1; i <= row; i++ {
		for j := 1; j <= col && j <= i; j++ {
			//res = i * j
			//fmt.Print(res)
			//if j <= i {
			fmt.Printf("%d*%d=%d \t", j, i, j*i)
			//}
		}
		fmt.Println()
	}

}
